﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ArivisAccounts.Models
{
    public class EditUserModel
    {
        [Display(Name = "User Name")]
        [Required]
        public string User { get; set; }

        [Display(Name = "Roles for User")]
        public string[] RolesForUser { get; set; }

        public string[] AllRoles { get; set; }

        public static EditUserModel Create(UserProfile profile)
        {
            return new EditUserModel
            {
                User = profile.UserName,
                RolesForUser = System.Web.Security.Roles.GetRolesForUser(profile.UserName)
            };
        }
    }
}